﻿using System;
using QuadraticEquationPresenter;
using Infrastructure;

namespace SolvingQuadraticEquationTests
{
    class FakeView : IQuadraticEquationView
    {
        public string aField { get; set; }
        public string bField { get; set; }
        public string cField { get; set; }
        public string x1Field { get; set; }
        public string x2Field { get; set; }
        public string messageAboutRootsField { get; set; }
        public string errorMessageField { get; set; }
        public string logText { get; set; }

        public event Action solveButtonPressed;
        public event Action showLogButtonPressed;
        public event Action<bool> loggerStateChangedToFileLogger;

        public void buttonSolve_Click()
        {
            solveButtonPressed();
        }
        public void buttonShowLog_Click()
        {
            showLogButtonPressed();
        }

        public ILogger getFileLogger()
        {
            return new FileLogger();
        }

        public ILogger getHTMLLogger()
        {
            return new HTMLLogger();
        }
        public void loggerChanged(bool file)
        {
            loggerStateChangedToFileLogger(file);
        }
    }
}
